<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="com.studio.julianne.model.*" %>
<%@ page import="com.studio.julianne.dao.*" %>
<%@ page import="com.studio.julianne.PMF" %>


<%@page import="org.apache.commons.lang.builder.ToStringBuilder"%><html>
<html>
  <body>

<%
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (user != null) {
%>
<p>Hello, <%= user.getNickname() %>! (You can
<a href="<%= userService.createLogoutURL(request.getRequestURI()) %>">sign out</a>.)</p>
<%
    } else {
%>
<p>Hello!
<a href="<%= userService.createLoginURL(request.getRequestURI()) %>">Sign in</a>
to include your name with greetings you post.</p>
<%
    }
%>


    <form action="/student_add" method="post">
      <div>First name:<input name="student.firstName" type="text" /></div>
      <div>Last name:<input name="student.lastName" type="text" /></div>
      <div>Birthday:<input name="student.birthday" type="text" /></div>
      <div>Memo:<input name="student.memo" type="text" /></div>
      <div><input type="submit" value="Add Student" /></div>
    </form>

  </body>
</html>